<?php

namespace App\Admin\Renderable;

use App\Admin\Repositories\School;
use App\Models\User;
use Dcat\Admin\Grid;
use App\Models\Store;
use Dcat\Admin\Admin;
use App\Enums\SexType;
use App\Enums\LevelAuthEnum;
use Dcat\Admin\Grid\LazyRenderable;


class SchoolTable extends LazyRenderable
{
    public function grid(): Grid
    {
        return Grid::make(new School, function (Grid $grid) {
            $grid->column('id')->sortable();
            $grid->column('name');
            $grid->column('address','地址');
            $grid->column('tel');
            $grid->column('memo');
            $grid->column('created_at')->format('Y-m-d H:i:s');
            $grid->column('updated_at')->format('Y-m-d H:i:s');
            $grid->filter(function (Grid\Filter $filter) {
                $filter->equal('id');
                $filter->like('name');
                $filter->like('address','地址');
                $filter->like('tel');
                $filter->like('memo');
            });
            $grid->disableActions();
            // $grid->enableDialogCreate();
            // $grid->showQuickEditButton();
            // $grid->paginate(5);
            $grid->disablePagination();
        });
    }
}
